package ezonsport.android.application;

import com.j256.ormlite.android.apptools.OrmLiteBaseTabActivity;

import ezonsport.android.data.DataHelper;
import ezonsport.android.ui.FeedActivity;

import ezonsport.android.ui.HelpActivity;
import ezonsport.android.ui.InformationActivity;
import ezonsport.android.ui.MoreOperationActivity;
import ezonsport.android.ui.SettingActivity;
import ezonsport.android.ui.stepSystem.dataHistory.DataHistoryActivity;
import ezonsport.android.ui.stepSystem.dataView.DataViewActivity;
import ezonsport.android.R;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class EzonSportMobileV2Activity extends TabActivity {

	private TabHost m_tabHost;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
		// WindowManager.LayoutParams.FLAG_FULLSCREEN);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.main);
		m_tabHost = getTabHost();

		addDataViewTab();
		addDataHistoryTab();
		// addFeedTab();
		addInformationTab();
		// addSettingTab();
		// addHelpTab();
		addMoreOperationTab();
	}

	public void addDataViewTab() {
		Intent intent = new Intent();
		intent.setClass(EzonSportMobileV2Activity.this, DataViewActivity.class);

		TabSpec spec = m_tabHost.newTabSpec("DataView");
		spec.setIndicator(getString(R.string.tab_dataview));
		spec.setContent(intent);
		m_tabHost.addTab(spec);
	}

	public void addSettingTab() {
		Intent intent = new Intent();
		intent.setClass(EzonSportMobileV2Activity.this, SettingActivity.class);

		TabSpec spec = m_tabHost.newTabSpec("Setting");
		spec.setIndicator(getString(R.string.tab_setting));
		spec.setContent(intent);
		m_tabHost.addTab(spec);

	}

	public void addInformationTab() {
		Intent intent = new Intent();
		intent.setClass(EzonSportMobileV2Activity.this,
				InformationActivity.class);

		TabSpec spec = m_tabHost.newTabSpec("Information");
		spec.setIndicator(getString(R.string.tab_information));
		spec.setContent(intent);
		m_tabHost.addTab(spec);
	}

	public void addDataHistoryTab() {
		Intent intent = new Intent();
		intent.setClass(EzonSportMobileV2Activity.this,
				DataHistoryActivity.class);

		TabSpec spec = m_tabHost.newTabSpec("DataHistory");
		spec.setIndicator(getString(R.string.tab_data_history));
		spec.setContent(intent);
		m_tabHost.addTab(spec);
	}

	public void addMoreOperationTab() {
		Intent intent = new Intent();
		intent.setClass(EzonSportMobileV2Activity.this,
				MoreOperationActivity.class);

		TabSpec spec = m_tabHost.newTabSpec("MoreOperation");
		spec.setIndicator(getString(R.string.tab_more_operations));
		spec.setContent(intent);
		m_tabHost.addTab(spec);
	}

	public void addHelpTab() {
		Intent intent = new Intent();
		intent.setClass(EzonSportMobileV2Activity.this, HelpActivity.class);

		TabSpec spec = m_tabHost.newTabSpec("Help");
		spec.setIndicator(getString(R.string.tab_help));
		spec.setContent(intent);
		m_tabHost.addTab(spec);
	}

	public void addFeedTab() {
		Intent intent = new Intent();
		intent.setClass(EzonSportMobileV2Activity.this, FeedActivity.class);

		TabSpec spec = m_tabHost.newTabSpec("Feed");
		spec.setIndicator(getString(R.string.tab_feed));
		spec.setContent(intent);
		m_tabHost.addTab(spec);
	}

}